var HIDE_PANEL_TIME = 50;
-var InputMethod = GObject.registerClass(
-class InputMethod extends Clutter.InputMethod {
+var InputMethod = GObject.registerClass({
+ Signals: {
+ 'surrounding-text-set': {},
+ },
+}, class InputMethod extends Clutter.InputMethod {
_init() {
super._init();
this._hints = 0;
this._emitRequestSurrounding();
}
+ this._surroundingText = null;
+ this._surroundingTextCursor = null;
this._preeditStr = null;
}
}
vfunc_set_surrounding(text, cursor, anchor) {
+ this._surroundingText = text;
+ this._surroundingTextCursor = cursor;
+ this.emit('surrounding-text-set');
+
if (!this._context || !text)
return;
});
return true;
}
+
+ getSurroundingText() {
+ return [this._surroundingText, this._surroundingTextCursor];
+ }
});